// using UnityEngine;

// public class UpCardBagScroll : MonoBehaviour
// {
//     [SerializeField] private UpCardBagContent upCardBagContent;

//     [SerializeField, Range(0.1f, 10f)] 
//     private float scrollSensitivity = 1f; // 滚轮灵敏度，Inspector可调

//     private float scrollAccumulator = 0f;
//     private float scrollThreshold = 1f; // 移动一次的滚轮阈值，通常滚轮delta是1

//     void Update()
//     {
//         float scrollDelta = Input.mouseScrollDelta.y * scrollSensitivity;
//         if (scrollDelta == 0) return;

//         scrollAccumulator += scrollDelta;

//         // 当累计滚轮值超过阈值才触发移动，防止过快
//         //content移动方向和滚轮相反
//         while (scrollAccumulator >= scrollThreshold)
//         {
//             upCardBagContent.MoveCardsDown();
//             scrollAccumulator -= scrollThreshold;
//         }
//         while (scrollAccumulator <= -scrollThreshold)
//         {
//             upCardBagContent.MoveCardsUp();
//             scrollAccumulator += scrollThreshold;
//         }
//     }
// }
